1. Home
  2. Python
  3. Python Functions
  4. Python input() Function

Python input() Function

Working with Python input() Function

The Python input() function is used to take input from standard input devices. With the help of this function, you can ask user to provide values to a program at run time.

When a Python program is running and a input function is called. The program execution will wait until the user send a input and press return key.

Syntax

input(prompt)

Example:

Below sample Python program will print a message on screen. Then input() will ask your to enter your name.

Another example of Python input() function. Here the prompt message is passed as a parameter.

Tags ,